home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / tests / fstrash / RCS / fstrash.man,v < prev   
Encoding:
Text File  |  1990-07-10  |  9.3 KB  |  261 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    jhh:1.1; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.1
  10. date     90.07.09.21.45.39;  author jhh;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @' Copyright 1989 Regents of the University of California
  26. ' Permission to use, copy, modify, and distribute this
  27. ' documentation for any purpose and without fee is hereby
  28. ' granted, provided that this notice appears in all copies.
  29. ' The University of California makes no representations about
  30. ' the suitability of this material for any purpose.  It is
  31. ' provided "as is" without express or implied warranty.
  32. ' $Header: /sprite/lib/forms/RCS/proto.man,v 1.3 89/01/09 11:43:01 ouster Exp $ SPRITE (Berkeley)
  33. .so \*(]ltmac.sprite
  34. .HS fstrash cmds
  35. .BS
  36. .SH NAME
  37. fstrash \- Produces a completely trashed filesystem.
  38. .SH SYNOPSIS
  39. .nf
  40. \fBfstrash -dev \fIdevice\fP -part \fIpartition\fP [\fIoptions\fR]
  41. .SH OPTIONS
  42. .IP "\fB\-dev\fI device\fR" 14
  43. \fIDevice\fP is the root name of a device, i.e. rxy0, rsd1, rsb0
  44. .IP "\fB\-part\fI partition\fR" 14
  45. \fIPartition\fP is a letter indicating a partition, i.e. a, b, c, d, e, f, g.
  46. .IP "\fB\-dir\fI devDir\fR" 14
  47. \fIDevDir\fR is an alternate directory in which to find the device file
  48. named by concatenating \fIdevice\fR and \fIpartition\fR.  The default 
  49. directory name is ``/dev/``.
  50. .IP "\fB\-initialPart\fI firstPartName\fR" 14
  51. \fIfirstPartName\fP is the name of the initial partition on the disk
  52. which contains basic disk geometry information.  The default is partition
  53. ``a''.
  54. .IP "\fB\-write\fR" 14
  55. Write the disk.  The default is to
  56. not write the disk.
  57. .IP "\fB\-overlap\fR" 14
  58. Overlap filesystem blocks across track boundaries. The default is to not overlap
  59. blocks.
  60. .IP "\fB\-copySuper\fR" 14
  61. Copy the super block to the partition. The default is to not copy.
  62. .IP "\fB\-ratio\fR" 14
  63. Ratio of Kbytes to file descriptors. The default is 4.
  64. .IP "\fB\-test\fR" 14
  65. Don't write to the disk. This is the default.
  66. .IP "\fB\-freeRoot\fR" 14
  67. Set the flag field in the root file descriptor to indicate that it is free.
  68. The default is to mark the root file descriptor as allocated.
  69. .IP "\fB\-fileRoot\fR" 14
  70. Set the filetype field in the root file descriptor to indicate that it is a
  71. file. The default is to make the root a directory.
  72. .IP "\fB\-noRoot\fR" 14
  73. Zero out both the root file descriptor and data block 0. The default is
  74. to fill in the descriptor and to add files to the root.
  75. This option has precedence over both \fB\-freeRoot\fR and \fB\-fileRoot\fR.
  76. .BE
  77.  
  78. .SH DESCRIPTION
  79. .PP
  80. This program produces a trashed file system. It is intended to be used to
  81. test the \fBfscheck\fR program. The above section illustrates the use of the
  82. options. This section outlines the errors that are built into the filesystem
  83. and the actions \fBfscheck\fR should take to correct those errors.
  84. .SS FILE DESCRIPTORS
  85. .LP
  86. The following is a list of the file descriptors, their status in the
  87. file descriptor bitmap, and the file they represent.
  88. .KS
  89. .DS L
  90. .nf
  91. File #        Name                Status
  92. .sp
  93. 0        not used by filesystem        marked
  94. 1        bad blocks            marked
  95. 2        root                marked
  96. 3        "lost+found"            marked
  97. 4        "testFile"            marked
  98. 5        unreferenced file        unmarked
  99. 6        "tooBig"            marked
  100. 7        "tooSmall"            marked
  101. 8         "holeFile"            marked
  102. 9        "holeDir"            marked
  103. 10        "badIndexFile"            marked
  104. 11        "illegalFrag"            marked
  105. 12        "copyBadFrag"            marked
  106. 13        "copyBlock"            marked
  107. 14        "copyIndBlock"            marked
  108. 15        "copyBogusInd"            marked
  109. 16        unreferenced file        unmarked
  110. 17        unreferenced file        marked
  111. 18        "output"            marked
  112. 20        unused but marked        marked
  113. .fi
  114. .DE
  115. .KE
  116. .LP
  117. Fscheck should change the file descriptor bitmap to indicate that files 5 and
  118. 16 are allocated and that file 20 is unallocated. 
  119.  
  120. .SS DATA BLOCKS
  121. .LP
  122. The following is a list of the data blocks, their status in the data block
  123. bitmap and the number of the file that uses them. The block numbers are for
  124. 1k blocks so they actually represent fragments. 
  125.  
  126. .KS
  127. .DS L
  128. .nf
  129. Block #            File #            Status
  130. .sp
  131. 0            2            marked
  132. 1            not used        marked
  133. 4 - 9            3            marked
  134. 10            3            unmarked
  135. 11            3            marked
  136. 12 - 15            6            marked
  137. 16 - 17            7            marked
  138. 20 - 31            8            unmarked
  139. 32 - 39            9            marked
  140. 40 - 43            not used
  141. 44 - 47            10            marked
  142. 48 - 51            10,14            marked
  143. 52 - 55            10,14            marked
  144. 56 - 59            10,13,14,15        marked
  145. 60             12            unmarked
  146. 61            11,12            marked
  147. 62            11,12            marked
  148. 63            12            unmarked
  149. 64            17            marked
  150. 68 - 75            18            marked
  151. .fi
  152. .DE
  153. .KE
  154. .LP
  155. The following blocks should be marked as in use by \fBfscheck\fR: 10, and 20-31.
  156. The following blocks should be marked as not in use: 1, 36-43, and 61.
  157. If the \fB\-delete\fR option of \fBfscheck\fR is not used, then \fBfscheck\fR 
  158. will 
  159. copy
  160. some of disk blocks. This will result in additional disk blocks being
  161. marked as in use. A total of 5 4k blocks are needed. There are two free 4k
  162. blocks in the range 36-43, so depending upon the \fBfscheck\fR implementation 
  163. these blocks may be reused. This would result in their status remaining
  164. unchanged, while 3 previously unused 4k blocks become used.
  165.  
  166. .SS FILES
  167. .LP 
  168. This section contains a description of the problems with each of the files
  169. created by \fBfstrash\fR and the actions \fBfscheck\fR should take to 
  170. correct them.
  171. .IP "File 1 - bad block file descriptor"
  172. File 1 is for bad blocks on the disk. Fscheck should not modify this descriptor
  173. unless the -badBlock option is given, in which case it should reset the
  174. contents of the descriptor.
  175. .IP "File 2 - \fIRoot\fR"
  176. If none of the "*Root" options are given the root directory should not be
  177. affected by \fBfscheck\fR. 
  178. If the \fB\-fileRoot\fR option is given to \fBfstrash\fR,
  179. then \fBfscheck\fR should reconstruct the root directory by adding file 3 
  180. (lost+found) to the root and updating the link count for file 3.
  181. If the \fB\-freeRoot\fR option is used, then \fBfscheck\fR should mark 
  182. file 2 as
  183. in use in addition to adding file 3 to the root.
  184. The \fB\-noRoot\fR option forces \fBfscheck\fR to do a lot of work 
  185. to fix the root.
  186. First, file 2 has to be marked in use. Secondly, any file that is using block
  187. 0 should either have this block deleted or a copy made. File 3 should be
  188. put in the root, and all other files should be put in file 3.
  189. .IP "File 3 - \fIlost+found\fR"
  190. The \fIlost+found\fR directory should be in the root and 
  191. should have its link count
  192. corrected when file 17 (an unreferenced directory) is added to it.
  193. .IP "File 4 - \fItestFile\fR"
  194. \fItestFile\fR is an empty file that is a child of the root. It should not be 
  195. modified by \fBfscheck\fR.
  196. .IP "File 5 - an unreferenced file"
  197. File 5 is an empty, unreferenced file that should be put into lost+found.
  198. .IP "File 6 - \fItooBig\fR"
  199. The size of the file \fItooBig\fR is greater than the amount of
  200. space in its data
  201. blocks. Its length should be truncated to the size of one direct block (4096
  202. bytes).
  203. .IP "File 7 - \fItooSmall\fR"
  204. The size of the file \fItooSmall\fR is smaller than the amount of space in its
  205. data blocks. Direct block 1 (17) should be deleted and its block count 
  206. corrected
  207. from 2 to 1.
  208. .IP "File 8 - \fIholeFile\fR"
  209. \fIholeFile\fR is a file with a hole in most of its direct blocks. 
  210. \fBfscheck\fR should not
  211. modify this file.
  212. .IP "File 9 - \fIholeDir\fR"
  213. Holes are not allowed in directories, so \fBfscheck\fR should 
  214. fill in the hole with empty entries. The hole is in the second direct block.
  215. .IP "File 10 - \fIbadIndexFile\fR"
  216. The \fIbadIndexFile\fR file has an invalid index in its first indirect block.
  217. This block (44) should be deleted so that the file has a hole, and the block
  218. count should be corrected from 1 to 4.
  219. The first direct block pointer is also invalid and should be made a hole.
  220. .IP "File 11 - \fIillegalFrag\fR"
  221. File 11 has a fragment that is not the last block in the file. This fragment
  222. (61)
  223. should be turned into a hole and the block count corrected from 2 to 1.
  224. .IP "File 12 - \fIcopyBadFrag\fR"
  225. The first direct block in file 12 shares one fragment with file 11. 
  226. It should be copied. The second direct block is a fragment that is also shared
  227. with file 11. Only one fragment's worth of data should be copied.
  228. .IP "File 13 - \fIcopyBlock\fR"
  229. This file contains 2 duplicate blocks. Block 0 is reserved for the root
  230. directory and should be either deleted or copied, even if the root directory
  231. doesn't exist. Block 56 is shared with file 10 and should be either copied
  232. or deleted.
  233. The doubly indirect block pointer is invalid (8). Indirect block pointers
  234. are physical block pointers, so the message about a bad pointer may display
  235. the wrong value. The block should be deleted and the size of the file 
  236. reduced to 8192 bytes.
  237. .IP "File 14 - \fIcopyIndBlock\fR"
  238. File 14 shares the doubly indirect block with file 10. New data blocks should
  239. be allocated for the doubly indirect block (48), the indirect block it contains
  240. (52),
  241. and the direct block it contains (56).
  242. .IP "File 15 - \fIcopyBogusIndBlock\fR"
  243. File 15 shares its doubly indirect block with file 10. Block 56 is not
  244. a valid indirect block and should be 
  245. deleted from file 15.
  246. This leaves file 15 with 0 blocks so it should be truncated to length
  247. 0 and the block count corrected from 1 to 0.
  248. .IP "File 16 - bad magic number"
  249. File 16 has a bad magic number and should be marked as free.
  250. .IP "File 17 - unreferenced directory"
  251. File 17 is an unreferenced directory that should be put in lost+found.
  252. The link counts in lost+found and file 17 should be fixed accordingly.
  253. .IP "File 18 - \fIoutput\fR"
  254. File 18 is the output file for saving the results of running fscheck. It
  255. initially has two data blocks allocated to it.
  256. .SH KEYWORDS
  257. filesystem fscheck fsmake
  258. @
  259.